public class Test {
    //关系运算符
    public static void main(String[] args) {
        int a=10;
        int b=20;
        System.out.println(a==b);//false
        System.out.println(a!=b);//true
        System.out.println(a>b);//false
        System.out.println(a<b);//true
        System.out.println(a>=b);//false
        System.out.println(a<=b);//true

        //System.out.println(3<a<b);//不合法，3<a是true,true<b

    }

    //+=,-=
    public static void main11(String[] args) {
       int a=10;
       long b=20;
       //a=(int)(a+b);
        a+=b;//相当于一次强制类型转换
       System.out.println(a);
    }
    //运算符%
    public static void main10(String[] args) {
        System.out.println(5%3);//2
        System.out.println(-5%3);//-2
        System.out.println(-5%-3);//-2
        System.out.println(5%-3);//2
        System.out.println(10.5%2.0);//0.5
    }
    //字符串类型
    public static void main9(String[] args) {
        String s1="hello";
        System.out.println(s1);

        String s2="word";
        System.out.println(s2);
//+:拼接
        String s3=s1+" "+s2;
        System.out.println(s3);

        int a=10;
        int b=20;
        System.out.println("a="+a+",b="+b);
        System.out.println("a+b="+a+b);//a+b=1020
        System.out.println("a+b="+(a+b));//a+b=30
        System.out.println(a+b+"=a+b");//30=a+b



        int k=123;
        String s=String.valueOf(k);//将传入的类型变成字符串
        System.out.println(s);

        String ss="123";
        //int m=Integer.valueOf(ss);//将传入的类型变成int型
        int m=Integer.parseInt(ss);//将传入的类型变成int型
        System.out.println(ss);
    }
    //输出
    public static void main8(String[] args) {
        System.out.println("输出且换行");
        System.out.print("输出但不换行");
        System.out.printf("%d\n",10);
    }
    //强制类型转换
    public static void main7(String[] args) {
        byte a=10;
        int b=128;
        a=(byte)b;
        System.out.println(a);

        byte c=10;
        byte d=20;
        int e=c+d;//小于4个字节参与运算会变成4个字节
        System.out.println(e);
    }


    //float
    public static void main6(String[] args) {
        float a=2.5f;
        System.out.println(a);
        char ch='A';
        //char ch1='大';
        char ch2=97;
        System.out.println(ch);
        //System.out.println(ch1);
        System.out.println(ch2);
    }
    //double
    public static void main5(String[] args) {
        double a=1.1;
        System.out.println(a);

        System.out.println(a*a);
        int b=1;
        int c=2;
        System.out.println(b/c);
    }
    //字节型
    public static void main4(String[] args) {
        byte a=10;
        System.out.println(a);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }

    //short
    public static void main3(String[] args) {
        short a=2;
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);
        System.out.println(a);
    }
    //long
    public static void main2(String[] args) {
        long a=10;
        System.out.println(a);

        System.out.println(Long.MIN_VALUE);
        System.out.println(Long.MAX_VALUE);
    }

    //int
    public static void main1(String[] args) {
        int a=10;

        int b;
        b=22;
        System.out.println(a);
//        int c;局部变量在使用之前一定要初始化
//        System.out.println(c);
        System.out.println(Integer.MIN_VALUE);
        System.out.println(Integer.MIN_VALUE);

        Integer d=100;
        System.out.println(d);

    }
}
